package com.example.dense_rack_server.controller;


import com.example.dense_rack_server.service.MyRoleUserService;
import com.example.dense_rack_server.utils.ResponseModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author  张彬 
 * @since 2025-03-03
 */
@RestController
@RequestMapping("/my/role/user")
public class MyRoleUserController {

    @Autowired
    private MyRoleUserService myRoleUserService;

    @PostMapping
    @ResponseBody
    @ApiOperation("通过用户id返回用户角色")
    public ResponseModel getRoleUserByUserId(@RequestBody Map<String,Integer> data){
        return myRoleUserService.getRoleUserByUserId(data.get("userId"));
    }
}
